﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCSService;

namespace SCS.Core.Models
{
    public class ArticaleMasterModel
    {
        #region "Articale Category"
        public static List<Article_Category> GetListArticleCategoryByParentId(int? cateID, int LanguagesID, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleCategoryByParentID(cateID, LanguagesID, siteGuid, null);
        }

        public static List<Article_Category> GetListArticalCategoryByParentIDSearch(int? parentID, int languageID, int siteGuid, string categoriesName, string categoriesAlias, string categoriesParams, int? categoriesOrdering, bool? categoriesActive, string categoriesUrl, string images)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleCategoryByParentIDSearch(parentID, languageID, siteGuid, categoriesName, categoriesAlias, categoriesParams, categoriesOrdering, categoriesActive, categoriesUrl,images);
        }

        public static List<Article_Category> GetListArticaleCategoryBySiteGuid(int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticaleCategoryBySiteGuid(siteGuid);
        }

        public static Article_Category GetArticleCategory(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetArticleCategoryByID(id);
        }

        public static int CreateArticleCategory(Article_Category cate)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.CreateArticle_Categories(cate);
        }

        public static void UpdateArticleCategory(Article_Category cate)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateArticleCategory(cate);
        }

        public static void UpdateStatusArticleCategory(int? id, bool? newStatus)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateStatusOfArticleCategory(id, newStatus);
        }

        public static void UpdateSortOrderArticleCategory(int? id, int? newSort)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateSortOrderOfArticleCategory(id, newSort);
        }

        public static void DeleteArticleCategory(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteArticleCategory(id);
        }

        public static int GetCountArticleCategory(int LanguagesID, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetCountArticleCategory(LanguagesID, siteGuid);
        }

        public static int GetCountArticleInArticleCategory(int cateId)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetCountArticleInCategory(cateId);
        }

        #endregion

        #region "Articale"
        public static List<Article> GetListArticleByCategoryID(int? cateID, int LanguagesID, int siteGuid, string Title, string IntroText, string FullText)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleByCategorySearch(cateID, LanguagesID, siteGuid, Title, IntroText, FullText);
        }

        public static List<Article> GetListArticleByCategoryAndSiteguid(int? cateID, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleByCategoryAndSiteguid(cateID, siteGuid);
        }
        public static Article GetArticleByID(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetArticle(id);
        }
        public static void UpdateArticleStatus(int? id, bool? newStatus)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateStatusArticle(id, newStatus);
        }

        public static int CreateArticle(Article art)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.CreateArticle(art);
        }

        public static void CreateArticleFrontpage(Article_Frontpage front)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.CreateArticleFrontpage(front);
        }

        

        public static List<int> GetListArticleCategoryIDFrontpageByArticleID(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleCategoryIDManageByArticleID(id);
        }

        public static void UpdateArticle(Article art)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateArticle(art);
        }

        public static List<Article_Frontpage> GetListArticleFrontpageByArticleID(int artId)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleFrontpageByArticleID(artId);
        }
        public static void DeleteArticleFrontpage(int ArticleID, int CategoriesID)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteArticleFrontpage(ArticleID,CategoriesID);
        }
        public static void DeleteArticle(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteArticle(id);
        }
        #endregion

        #region "Articale Static"
        public static int CreateArticleStatic(Article_Static art)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.CreateArticleStatic(art);
        }
        public static Article_Static GetArticleStaticByID(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetArticleStaticByID(id);
        }
        public static void UpdateArticleStatic(Article_Static art)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateArticleStatic(art);
        }
        public static List<Article_Static> GetListArticleStatic(int? id,int LanguagesID, int siteGuid, string StaticName, string StaticContent, string StaticIntroText, bool? Active)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticSearch(id,LanguagesID, siteGuid, StaticName, StaticContent, StaticIntroText,Active);
        }

        public static List<Article_Static> GetListArticleStaticByCategoryIdAndSiteGuid(int? cateId, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticByCategoryIdAndSiteGuid(cateId, siteGuid);
        }
        public static void DeleteArticleStatic(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteArticleStatic(id);
        }
        public static void UpdateArticleStaticStatus(int? id, bool? newStatus)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateStatusArticleStatic(id, newStatus);
        }

        public static List<Article_Static_Frontpage> GetListArticleStaticFrontpageByArticleStaticID(int artId)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListStaticArticleFrontpageByArticleStaticID(artId);
        }
        public static void DeleteArticleStaticFrontpage(int ArticleStaticID, int CategoriesStaticID)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteStaticArticleFrontpage(ArticleStaticID, CategoriesStaticID);
        }

        public static void CreateArticleStaticFrontpage(Article_Static_Frontpage front)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.CreateStaticArticleFrontpage(front);
        }
        #endregion

        #region "Static Articale Category"
        public static List<Artilce_Static_Category> GetListStaticArticleCategoryByParentId(int? cateID, int LanguagesID, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListStaticArticleCategoryByParentID(cateID, LanguagesID, siteGuid, null);
        }

        public static List<Artilce_Static_Category> GetListStaticArticleCategoryBySiteGuid(int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListStaticArticleCategoryBySiteGuid(siteGuid);
        }

        public static List<Artilce_Static_Category> GetListStaticArticalCategoryByParentIDSearch(int? parentID, int languageID, int siteGuid, string staticCategoriesName, string staticCategoriesAlias, string staticCategoriesParams, int? staticCategoriesOrdering, bool? staticCategoriesActive, string staticCategoriesUrl, string images)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticCategoryByParentIDSearch(parentID, languageID, siteGuid, staticCategoriesName, staticCategoriesAlias, staticCategoriesParams, staticCategoriesOrdering, staticCategoriesActive, staticCategoriesUrl, images);
        }

        public static Artilce_Static_Category GetStaticArticleCategory(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetArticalStaticCategoryByID(id);
        }

        public static int CreateStaticArticleCategory(Artilce_Static_Category cate)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.CreateArtical_Static_Category(cate);
        }

        public static void UpdateStaticArticleCategory(Artilce_Static_Category cate)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateStaticArticleCategory(cate);
        }

        public static void UpdateStatusStaticArticleCategory(int? id, bool? newStatus)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateStatusOfStaticArticleCategory(id, newStatus);
        }

        public static void UpdateSortOrderStaticArticleCategory(int? id, int? newSort)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.UpdateSortOrderOfStaticArticleCategory(id, newSort);
        }

        public static void DeleteStaticArticleCategory(int id)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            artSvc.DeleteStaticArticleCategory(id);
        }

        public static int GetCountStaticArticleCategory(int LanguagesID, int siteGuid)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetCountStaticArticleCategory(LanguagesID, siteGuid);
        }

        public static int GetCountStaticArticleInArticleCategory(int cateId)
        {
            SCSService.ArticleService artSvc = new ArticleService();
            return artSvc.GetCountStaticArticleInCategory(cateId);
        }

        #endregion
    }
}
